#
#   Copyright (C) 2012
#
#   This program is free software: you can redistribute it and/or modify
#   it under the terms of the GNU General Public License as published by
#   the Free Software Foundation, either version 3 of the License, or
#   (at your option) any later version.
#
#   This program is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#   GNU General Public License for more details.
#
#   You should have received a copy of the GNU General Public License
#   along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
#-----------------------------------------------------------------------
#
#   This code produces a 3D plot of the X,P and T values imported from Richardson_RK4.
#

import matplotlib.pyplot as plt
from numpy import *
import mpl_toolkits.mplot3d.axes3d as p3
import pickle

#Import data generated by Richardson_RK4_SHO
A=transpose(genfromtxt("./RichardsonRK4.csv", unpack=True, delimiter=','))

T=A[:,0]
X=A[:,1]
P=A[:,2]

#Create figure

ax = p3.Axes3D(plt.figure())
ax.scatter(X,P,T, s=1)
#ax.plot_wireframe(X,T,P)
#ax.contourf(X, T, P, zdir='z', offset=0, cmap=cm.hot)
ax.set_ylim(-10,10)
ax.set_xlim(-10,10)
ax.set_xlabel('X')
ax.set_ylabel('P')
ax.set_zlabel('T')
plt.show()
#savefig('Z:/Desktop/Project/bhmqntm-code/plot3d_ex.png',dpi=48)

